<?php
namespace TpAmisAdmin\Admin\service;

use think\facade\Route;
use think\Service;

class RouteService extends Service
{
    public function boot()
    {
        Route::group('test', function () {
            // 注册路由
            Route::get('hello', function () {
                return 'Hello, ThinkPHP 6!';
            });
        });
        // 还可以注册分组路由
        Route::group('api', function () {
            Route::get('user', 'app\controller\UserController@getUser');
            Route::post('user', 'app\controller\UserController@createUser');
        });
    }
}